﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Profile.aspx.vb" Inherits="Travelling_Alone.Profile" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<style type="text/css">
        .style2
        {
            font-size: x-large;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p class="style2">
        User Profile </p>
    <p style="font-size:medium">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            BorderStyle="None" DataSourceID="ProfilePhotoSource">
            <Columns>
                <asp:ImageField DataImageUrlField="picture" DataImageUrlFormatString="{0}">
                    <ControlStyle CssClass="gridviewphoto" />
                </asp:ImageField>
            </Columns>
        </asp:GridView><br />
        <asp:ListView ID="ProfileListView" runat="server" 
        DataSourceID="ProfileDetailsSource">
            <AlternatingItemTemplate>
                <span style="background-color: #FFF8DC;">First Name:
                <asp:Label ID="first_nameLabel" runat="server" 
                    Text='<%# Eval("first_name") %>' />
                <br />
                Last Name:
                <asp:Label ID="last_nameLabel" runat="server" Text='<%# Eval("last_name") %>' />
                <br />
                Nationality:
                <asp:Label ID="nationalityLabel" runat="server" 
                    Text='<%# Eval("nationality") %>' />
                <br />
                About:
                <asp:Label ID="short_descriptionLabel" runat="server" 
                    Text='<%# Eval("short_description") %>' />
                <br />
                Traveller Nickname:
                <asp:Label ID="traveller_nameLabel" runat="server" 
                    Text='<%# Eval("traveller_name") %>' />
                <br />
<br /></span>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <span style="background-color: #008A8C;color: #FFFFFF;">First Name:
                <asp:TextBox ID="first_nameTextBox" runat="server" 
                    Text='<%# Bind("first_name") %>' />
                <br />
                Last Name:
                <asp:TextBox ID="last_nameTextBox" runat="server" 
                    Text='<%# Bind("last_name") %>' />
                <br />
                Nationality:
                <asp:TextBox ID="nationalityTextBox" runat="server" 
                    Text='<%# Bind("nationality") %>' />
                <br />
                About:
                <asp:TextBox ID="short_descriptionTextBox" runat="server" 
                    Text='<%# Bind("short_description") %>' />
                <br />
                Traveller Nickname:
                <asp:TextBox ID="traveller_nameTextBox" runat="server" 
                    Text='<%# Bind("traveller_name") %>' />
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
                <br /><br /></span>
            </EditItemTemplate>
            <EmptyDataTemplate>
                <span>No data was returned.</span>
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <span style="">First Name:
                <asp:TextBox ID="first_nameTextBox" runat="server" 
                    Text='<%# Bind("first_name") %>' />
                <br />Last Name:
                <asp:TextBox ID="last_nameTextBox" runat="server" 
                    Text='<%# Bind("last_name") %>' />
                <br />Nationality:
                <asp:TextBox ID="nationalityTextBox" runat="server" 
                    Text='<%# Bind("nationality") %>' />
                <br />About:
                <asp:TextBox ID="short_descriptionTextBox" runat="server" 
                    Text='<%# Bind("short_description") %>' />
                <br />Traveller Nickname:
                <asp:TextBox ID="traveller_nameTextBox" runat="server" 
                    Text='<%# Bind("traveller_name") %>' />
                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Clear" />
                <br /><br /></span>
            </InsertItemTemplate>
            <ItemTemplate>
                <span style="background-color: #DCDCDC;color: #000000;">First Name:
                <asp:Label ID="first_nameLabel" runat="server" 
                    Text='<%# Eval("first_name") %>' />
                <br />
                Last Name:
                <asp:Label ID="last_nameLabel" runat="server" Text='<%# Eval("last_name") %>' />
                <br />
                Nationality:
                <asp:Label ID="nationalityLabel" runat="server" 
                    Text='<%# Eval("nationality") %>' />
                <br />
                About:
                <asp:Label ID="short_descriptionLabel" runat="server" 
                    Text='<%# Eval("short_description") %>' />
                <br />
                Traveller Nickname:
                <asp:Label ID="traveller_nameLabel" runat="server" 
                    Text='<%# Eval("traveller_name") %>' />
                <br />
<br /></span>
            </ItemTemplate>
            <LayoutTemplate>
                <div ID="itemPlaceholderContainer" runat="server" 
                    style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                    <span runat="server" id="itemPlaceholder" />
                </div>
                <div style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                </div>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <span style="background-color: #008A8C;font-weight: bold;color: #FFFFFF;">
                first_name:
                <asp:Label ID="first_nameLabel" runat="server" 
                    Text='<%# Eval("first_name") %>' />
                <br />
                last_name:
                <asp:Label ID="last_nameLabel" runat="server" Text='<%# Eval("last_name") %>' />
                <br />
                nationality:
                <asp:Label ID="nationalityLabel" runat="server" 
                    Text='<%# Eval("nationality") %>' />
                <br />
                short_description:
                <asp:Label ID="short_descriptionLabel" runat="server" 
                    Text='<%# Eval("short_description") %>' />
                <br />
                traveller_name:
                <asp:Label ID="traveller_nameLabel" runat="server" 
                    Text='<%# Eval("traveller_name") %>' />
                <br />
<br /></span>
            </SelectedItemTemplate>
        
        </asp:ListView>
        <asp:SqlDataSource ID="ProfileDetailsSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TravellingAloneConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:TravellingAloneConnectionString.ProviderName %>" 
        SelectCommand="SELECT [first_name], [last_name], [nationality], [short_description], [traveller_name] FROM [profile] WHERE ([traveller_name] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="traveller_name" 
                    QueryStringField="TravellerName" Type="String" />
            </SelectParameters>
    </asp:SqlDataSource>
        <asp:SqlDataSource ID="ProfilePhotoSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:TravellingAloneConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:TravellingAloneConnectionString.ProviderName %>" 
            SelectCommand="SELECT [picture] FROM [profile] WHERE ([traveller_name] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="traveller_name" 
                    QueryStringField="TravellerName" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    
    
    
     <p>
    
    
        <asp:Button ID="btn_edit_profile" runat="server" Text="Edit Profile" 
            PostBackUrl="~/Edit_Profile.aspx" />
    
    
    </p>
    
</asp:Content>
